UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wVjv5JMObcD9MZ83HuKaZPZocJlsnJ4FRuaFZhvWnA='
WHERE
key_id = '9fc7a9461570bcf7e666b426ec4f31b02bed83fc32600b3e1119c71cdf4605cc'
AND (
token = '7wVjv5JMObcD9MZ83HuKaZPZocJlsnJ4FRuaFZhvWnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)