UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0VeaDMirhs6hLazAUNIJYRXvNGeeEtaKcChn9i2/u+w=' 
WHERE 
  key_id = 'aab05c644b48a0fed25c8593c4690f4b7897f8587cad82b91c561a3de2156558' 
  AND (
    token = '0VeaDMirhs6hLazAUNIJYRXvNGeeEtaKcChn9i2/u+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038