UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lab6bSEon4XWvusDIEvkXSX5cpnNfMnwIdm4FWgswgk='
WHERE
key_id = '32d9bd14b5c5fd39c77c3093654cbdf03977093aec58ad44c8cce8da12c32bf3'
AND (
token = 'lab6bSEon4XWvusDIEvkXSX5cpnNfMnwIdm4FWgswgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)