UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'td35G0wnmvur8R2WULsOwGMAoBs2+wcyjMlLZdjJNJY='
WHERE
key_id = 'b70e58fbd9dab608db19ef05ab6b8ca613971aea76c8b2fa9596ec6354f1ade1'
AND (
token = 'td35G0wnmvur8R2WULsOwGMAoBs2+wcyjMlLZdjJNJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)