UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8SkyyyOpQ3+3GraQ00vDLWI4hEh4EKQ2m1Glwnpizww='
WHERE
key_id = 'f4e8ad18745abfbf2b73c92410b92d3381c9bfac42beb5080e572c3cbd75af28'
AND (
token = '8SkyyyOpQ3+3GraQ00vDLWI4hEh4EKQ2m1Glwnpizww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)