UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ve0dJvoCvSe/rJil8xIbgEcsVhFb9W7EyiZhLSAJ+tU=' 
WHERE 
  key_id = '9f988fb50ad101960cefab37e7c3480fd8cc5d6ec618663699b5b64ff84bedff' 
  AND (
    token = 'Ve0dJvoCvSe/rJil8xIbgEcsVhFb9W7EyiZhLSAJ+tU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032