UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8oXlPpWYSIujul2zVukg1CC/Xv6K+St4+1YGhrAGOpU='
WHERE
key_id = 'eba38d99433d6a89291fd77fba61c4a45b8c444eff3dbd147837c83fb5142086'
AND (
token = '8oXlPpWYSIujul2zVukg1CC/Xv6K+St4+1YGhrAGOpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)