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