UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MwrElHJJUGP3pLrhvCByBBHP57JOUuI+3z503OyR5W0=' 
WHERE 
  key_id = '29b7d28a797f1118ed818610e0704cc8507b5f3d3f7da2adef8d0aeb83dc156c' 
  AND (
    token = 'MwrElHJJUGP3pLrhvCByBBHP57JOUuI+3z503OyR5W0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047