UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9MreaHp19kL/oWMq9xHYC2HSjFYftpSL9hY1iMHtMEM='
WHERE
key_id = 'fe0ecba8b246641260c2f8f4e1fae38cde0846a7f9cbf22ebf609c48c932cd15'
AND (
token = '9MreaHp19kL/oWMq9xHYC2HSjFYftpSL9hY1iMHtMEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)