UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+UREZodcrRnje4KFs/zfZPrNme3hT4w3CZPxasMNIn0=' 
WHERE 
  key_id = '1a486916fbe1765e7b5ba4aea1e4fc24155886ef7c8f389095a462d57a32cfa4' 
  AND (
    token = '+UREZodcrRnje4KFs/zfZPrNme3hT4w3CZPxasMNIn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00105