UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gl2rcs5peecnguLLlSjyHBhTUEee/n6grENIMjOvUV4='
WHERE
key_id = '55ed9990a72120fc35a12dbe4bab0741c1acfb54da923a576ff82bb39bf8b1d4'
AND (
token = 'Gl2rcs5peecnguLLlSjyHBhTUEee/n6grENIMjOvUV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)