UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Db+yTfdQSvxRsvMFjwSfjtm3oZyx3cjSchnCwKgo2oQ='
WHERE
key_id = 'c2ccb7eef1f671564c289f2c146d53aeaa46c6d715b9cda337e3406ad5447b84'
AND (
token = 'Db+yTfdQSvxRsvMFjwSfjtm3oZyx3cjSchnCwKgo2oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)