UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nBcjHemu6KD6xvwTIYGzoRsKGr/uqpSiH/zw/xJPvw4=' 
WHERE 
  key_id = '2853a2c711d091148831ccc44af0327dbff807983f6b5bb86160f168c634eb18' 
  AND (
    token = 'nBcjHemu6KD6xvwTIYGzoRsKGr/uqpSiH/zw/xJPvw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019