UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pecudzc3GwPftbXoYtpdah+o+TSBbz6F6YUw1x050xY=' 
WHERE 
  key_id = 'eb18ddf024e94c2b2e02fe4c0b1fdfbbb5abf79c30cd6441280faae1544cd151' 
  AND (
    token = 'pecudzc3GwPftbXoYtpdah+o+TSBbz6F6YUw1x050xY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020