UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '65QJBi0WcrBD1VElXMgu4njIozWoqODRkbTawmrr1hQ='
WHERE
key_id = '7b9dfee9e6b8786e9e8c6cd86f0fa232aeed5ad4a86153d289d0061e9618f5f9'
AND (
token = '65QJBi0WcrBD1VElXMgu4njIozWoqODRkbTawmrr1hQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)