UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kX8fCw2CtKeZqq9xBUe8fv3wcdNeyt/VqUlaVti07+s='
WHERE
key_id = '6b79092eaf57a65d89132962d77ffb906dff8be6274a6d6ee823f4fd03a1dd5e'
AND (
token = 'kX8fCw2CtKeZqq9xBUe8fv3wcdNeyt/VqUlaVti07+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)