UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PmdsNh741JxLWga35gWiinzHP6tK7voclg6DiVOTYmE=' 
WHERE 
  key_id = '9e59eb9df3f59c8411d27f1a1927d899f2a8f1668c69d75d20c2b3de58b787eb' 
  AND (
    token = 'PmdsNh741JxLWga35gWiinzHP6tK7voclg6DiVOTYmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016