UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Ww81IKT7JIH6TzjMNfyTIc1Mz1aMCOg7cO3VDXduLU='
WHERE
key_id = '272cc9baed38093d2db5c6463d0a27c9249150295fda6ea1f6abdb29762eec2f'
AND (
token = '7Ww81IKT7JIH6TzjMNfyTIc1Mz1aMCOg7cO3VDXduLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)