UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J7uCGp5K2CkAwr8aDppYhUnOBD5Sh//pVqlKmQZQvmQ=' 
WHERE 
  key_id = '5e80301e84371e722132e312e667eeff6895026d4984989bf96af2de406f8bc1' 
  AND (
    token = 'J7uCGp5K2CkAwr8aDppYhUnOBD5Sh//pVqlKmQZQvmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020