UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XtkW4x8hRgckr+Cwu7Fq8TAw6jIwQHEr4ZCzp64BO3A='
WHERE
key_id = '9cc4c8fc92a23505dc9367774477adccb1436ea2d8114da387390fd273e2b44a'
AND (
token = 'XtkW4x8hRgckr+Cwu7Fq8TAw6jIwQHEr4ZCzp64BO3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)