UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gOoZeyWJNuSKF3wiBZ/nksOYcoEl3zEJ8HYyzOud5xQ=' 
WHERE 
  key_id = '69343af3a57536c1abeaaf2f1fb332109bc5bd01e597a3d8b17e5179be46def0' 
  AND (
    token = 'gOoZeyWJNuSKF3wiBZ/nksOYcoEl3zEJ8HYyzOud5xQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029