UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QG2NxbnXihO/AvUFjPZH4DD4jCMkQSBTgfJ7mFrUgp4='
WHERE
key_id = '11a86a6a6d0ef0bd776f30ea51ac58b12ca03ee34af1ddbe717624a6a955826c'
AND (
token = 'QG2NxbnXihO/AvUFjPZH4DD4jCMkQSBTgfJ7mFrUgp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)