UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eebemYYtdlOYO/dEmDI2461rvfypTd/LKug86IEDRBA='
WHERE
key_id = 'c5767018e08d6c3b42194b913a71ac2c4b24ea9d75c0184fb97e3f17ea9406ae'
AND (
token = 'eebemYYtdlOYO/dEmDI2461rvfypTd/LKug86IEDRBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)