UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XBx6f7553BrjfkcY1KtX8lsKV6jS4sYTdhSstFPC9g='
WHERE
key_id = '68cf4d8be02d194409f65d146844215b5c73c3968e77ea2d7fd0b06f8677e6f1'
AND (
token = '0XBx6f7553BrjfkcY1KtX8lsKV6jS4sYTdhSstFPC9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)