UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5RokPMX5vHItZsgNqkfyuMDuPZorEczhVAf9bTowHJM='
WHERE
key_id = '892f857c0245ca6ae8d7e8c4582eba08cec701d5074c449e674b89279bcddcbb'
AND (
token = '5RokPMX5vHItZsgNqkfyuMDuPZorEczhVAf9bTowHJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)