UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CExkztN3jRkNUs5076NXSbkvB+ok/RTtEovMa2g8dcc=' 
WHERE 
  key_id = '75b39d5130f2aa49d99f8db475927530fba9fcae611ebbdd6a81e7073113d5ea' 
  AND (
    token = 'CExkztN3jRkNUs5076NXSbkvB+ok/RTtEovMa2g8dcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021