UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4OOsMiRHTpweeLrzaIdbYdjiTKXSYLjHrgXOuFrK0Q=' 
WHERE 
  key_id = '3027eb1d8974adba8f2bf1b088e24f1bb59e413c022ed268e0b8d1e14aa3504f' 
  AND (
    token = 'G4OOsMiRHTpweeLrzaIdbYdjiTKXSYLjHrgXOuFrK0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020