UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8QDROBR8dnIiZ/3J2dCK32bHixKds17dV5lCj5S+IE4='
WHERE
key_id = 'ce53e9d489cf84d4239cae064ed7cfa4b0e78587b8d23d867d2ebfb6be5aeb32'
AND (
token = '8QDROBR8dnIiZ/3J2dCK32bHixKds17dV5lCj5S+IE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)