UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rK0TNGRMQ8J0uWlg1Kwf2OuBNddifyskyBFPhfdhWwg='
WHERE
key_id = '1dffc7e9bdb49ae84fb9711086fcf090b443d61e3d19dd9f13d470b8e9fac95e'
AND (
token = 'rK0TNGRMQ8J0uWlg1Kwf2OuBNddifyskyBFPhfdhWwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)