UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YvM82lEnXtenbita9PvubWVoJHboHnIFqfFQ85YGV0A=' 
WHERE 
  key_id = 'ef5242a7ffcc50096628efa73b743db16bd3f93477b0fb1ccbeee013273bd880' 
  AND (
    token = 'YvM82lEnXtenbita9PvubWVoJHboHnIFqfFQ85YGV0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044