UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yO6fF7k/A+3Vrw2kbdziswvMqk34VzTZ6OYmGSiPBpw=' 
WHERE 
  key_id = '63005762b2c557f4b28f33957e2ae91fa0a21960990cbc46ec8d877632bafb34' 
  AND (
    token = 'yO6fF7k/A+3Vrw2kbdziswvMqk34VzTZ6OYmGSiPBpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031