UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yHcoZj2EWgvWfU6ev0U21J32l+7QfeLcDl1SGY6TBk='
WHERE
key_id = '2194ffed8e488ba8f65ad2ac3fa2720d01da6c620dd2d1ecfc6e00545ed4abe3'
AND (
token = '6yHcoZj2EWgvWfU6ev0U21J32l+7QfeLcDl1SGY6TBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)