UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GHPZqQZueZOm55xZLW5jh/+EPmY2Q9aKQyPYLjGebUw='
WHERE
key_id = '7717252185dd8f070e08ba08fb4c29fa45d6fe67c70b2d190a704a52552a948e'
AND (
token = 'GHPZqQZueZOm55xZLW5jh/+EPmY2Q9aKQyPYLjGebUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)