UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZNowRJIT8cGxvn0HmgDMYc+WXoRdICFfdJCqdErSGr8='
WHERE
key_id = 'cf576ff236bbe38bd1528be69904ebecdefdde2eebed6b0068bf00e24ec06d02'
AND (
token = 'ZNowRJIT8cGxvn0HmgDMYc+WXoRdICFfdJCqdErSGr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)