UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LsExIb8l0/DO8+BOkU+2a1Fy9UrafzlsarMOqaG4rU='
WHERE
key_id = '6492083f5c4675c9bfc0838457b3b62f5c62df5eda6175ccc0c25c00e7490c53'
AND (
token = '2LsExIb8l0/DO8+BOkU+2a1Fy9UrafzlsarMOqaG4rU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)