UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QAgoOVQNumrMpWcglVQ5vEVjH5VTA0bGhRVXeIoaqtI='
WHERE
key_id = '9836b0dcb39f7e283b26cf003e6bc6a920cb8085bdc4bc9f9288133fddc07173'
AND (
token = 'QAgoOVQNumrMpWcglVQ5vEVjH5VTA0bGhRVXeIoaqtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)