UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8eJNeShu8MtV73yzknRPomC91LpSdbSRoVZnuNNzzho='
WHERE
key_id = 'c0214b59cafadf6d6d46d5769a43d38020a0f8c64d5fabc6d0ec1bf442fdc11d'
AND (
token = '8eJNeShu8MtV73yzknRPomC91LpSdbSRoVZnuNNzzho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)