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