UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L9QWS+5ix4VKW8Kojg+nqLJc6HBfxnlyH+WhZ+fXTBM='
WHERE
key_id = '8b88cfbab60ed1b1335c466ae061174f48db4ac468fbb03597f9507c4c0b54cd'
AND (
token = 'L9QWS+5ix4VKW8Kojg+nqLJc6HBfxnlyH+WhZ+fXTBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)