UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZFB5libRIxOV7hfu0JFP9g2yrBbJuuZqN1hpmf8vpYU='
WHERE
key_id = 'd23a6fa8330b70a134976e9d6c84a615580fda5b3cbb6765ffb242679aef4b2b'
AND (
token = 'ZFB5libRIxOV7hfu0JFP9g2yrBbJuuZqN1hpmf8vpYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)