UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YkcmvrG2Mgg7VYNTPsQtUxEbs3h6CA/H5YRjUzLbgzE=' 
WHERE 
  key_id = '65ee8c0a2cce41ec39d7339173f2ea129f1d046e065588d961d354f4a97285ba' 
  AND (
    token = 'YkcmvrG2Mgg7VYNTPsQtUxEbs3h6CA/H5YRjUzLbgzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026