UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c281Yqvzs5h4xKtUcwSOE1ACyJs+tDmaV5L97hBnvXE='
WHERE
key_id = '1435b84a0aea3f3577f78f6ee0e24569df099cdde78db09e9ecb976379d1b478'
AND (
token = 'c281Yqvzs5h4xKtUcwSOE1ACyJs+tDmaV5L97hBnvXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)