UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZe9gBhmarhe1W8hhmvg029nDpUtcmmbIA796ijxdh8='
WHERE
key_id = '9670a364c92d5abd52df73f74795c9091ab1c4cbb1cdb74cea5c96a8045d3bb3'
AND (
token = 'kZe9gBhmarhe1W8hhmvg029nDpUtcmmbIA796ijxdh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)