UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8V3PDvCh3CPbdTP9Mw4dDeLwkuv0QQRYyJc3ei8EBjo='
WHERE
key_id = '9f0e33ac803aefc4b4afaaa851ac5474904e029b9aac8896068f97fef97baf63'
AND (
token = '8V3PDvCh3CPbdTP9Mw4dDeLwkuv0QQRYyJc3ei8EBjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)