UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uL0EIOCTWL8R734156FHI3Vcog1uoeZRRoY9Ks49rNw=' 
WHERE 
  key_id = '2ae8fb84c928fd3833f29e9efb7207a42c5c03d56410dcdd5b78ec54a56e6cd0' 
  AND (
    token = 'uL0EIOCTWL8R734156FHI3Vcog1uoeZRRoY9Ks49rNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00079