UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dcCSwA4MWfvnIowIdK6lcovUUULZijl67lKnAON4l7U='
WHERE
key_id = '069e09f1ba5ce6d7df5fdfedc73c344bccfa66c0b447cfb7a412d438f06014f8'
AND (
token = 'dcCSwA4MWfvnIowIdK6lcovUUULZijl67lKnAON4l7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)