UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gt6KkslZ+AZHYpREX+2o7/2eTEBn6tGWbSsDFT8g7i4=' 
WHERE 
  key_id = '32d5f49f24058bd8818fdde2920336a71fb315279051367cdd9d9f20bc226675' 
  AND (
    token = 'Gt6KkslZ+AZHYpREX+2o7/2eTEBn6tGWbSsDFT8g7i4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047